/******************************************************************************
* 文件名称: id_reg.h
* 内容摘要: 绑定 CAN ID 与其对应的数据接收处理函数 
* 创建者の: 孔佳伟
* 个人主页: https://gitee.com/thin-wind/jump
* 修改记录: 
******************************************************************************/


#ifndef __ID_REG_H_
#define __ID_REG_H_

#include <stdint.h>

typedef void (*pFunc)(uint8_t* buf, uint8_t len);

typedef struct IdReg_S
{
    uint32_t    id;
    pFunc       func;
} IdReg_S;

#define ID_REG(ID, FUNC)    \
static const volatile IdReg_S id_reg_##ID __attribute((section(".id_reg"))) = { \
    .id = ID,       \
    .func = FUNC,   \
}


#ifdef __cplusplus
extern "C" {
#endif



#ifdef __cplusplus
}
#endif


#endif // __ID_REG_H_

